<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
    <meta name="Generator" content="虚拟人 xuniren.com">
    <meta name="Author" content="广">
    <meta name="Keywords" content="脑语言 naoyuyan.com 虚世界 xushijie.com 卷王 asi7.com">
    <meta name="Description" content="脑语言：用2500单字统一文明">
    <title>naoyuyan.html 脑语言：用2500单字统一文明</title>
    <script src="https://cdn.tailwindcss.com"></script>
        <script>
        // 在加载tailwind之前配置darkMode
        tailwind.config = {
            darkMode: 'class'
        }
    </script>
    <style>
        .nav-link {
            @apply inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium transition-colors duration-200;
        }
        .nav-link.active {
            @apply border-indigo-500 text-gray-900 dark:text-white;
        }
        .nav-link:not(.active) {
            @apply border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-300 dark:hover:text-white;
        }
        .code-block {
            position: relative;
            transition: all 0.2s;
        }
        .code-block:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }
        .copy-button {
            position: absolute;
            top: 8px;
            right: 8px;
            padding: 4px 8px;
            background: rgba(99, 102, 241, 0.1);
            border-radius: 4px;
            font-size: 12px;
            cursor: pointer;
            opacity: 0;
            transition: opacity 0.2s;
        }
        .code-block:hover .copy-button {
            opacity: 1;
        }
        #code-editor {
            resize: none;
            font-family: monospace;
            line-height: 1.5;
        }
        .theme-switch {
            cursor: pointer;
            padding: 8px;
            border-radius: 50%;
            transition: all 0.2s;
        }
        .theme-switch:hover {
            background: rgba(156, 163, 175, 0.1);
        }
          .nav-link {
            @apply inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium transition-colors duration-200;
        }
        .nav-link.active {
            @apply border-indigo-500 text-gray-900 dark:text-white;
        }
        .nav-link:not(.active) {
            @apply border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-300 dark:hover:text-white;
        }
        .code-block {
            position: relative;
            transition: all 0.2s;
        }
        .code-block:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }
        .copy-button {
            position: absolute;
            top: 8px;
            right: 8px;
            padding: 4px 8px;
            background: rgba(99, 102, 241, 0.1);
            border-radius: 4px;
            font-size: 12px;
            cursor: pointer;
            opacity: 0;
            transition: opacity 0.2s;
        }
        .code-block:hover .copy-button {
            opacity: 1;
        }
        #code-editor {
            resize: none;
            font-family: monospace;
            line-height: 1.5;
        }
        .theme-switch {
            cursor: pointer;
            padding: 8px;
            border-radius: 50%;
            transition: all 0.2s;
        }
        .theme-switch:hover {
            background: rgba(156, 163, 175, 0.1);
        }
        .nav-link {
            padding: 4px 6px;
            padding-top: 13px;
        }
        .nav-link:hover {
            background: #ffff00;
            color: #000000;
        }
    </style>
</head>
<body class="bg-gray-50 dark:bg-gray-900 text-gray-900 dark:text-gray-100">
    <div class="flex flex-col min-h-screen">
        <!-- 导航栏 -->
        <nav class="bg-white dark:bg-gray-800 shadow-lg fixed w-full z-10">
            <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
                <div class="flex justify-between h-12">
                    <div class="flex">
                        <div class="flex-shrink-0 flex items-center">
                            <a href="#" class="nav-link text-2xl font-bold active pt-1" data-section="home">脑语言</a>
                        </div>
                        <div class="hidden sm:ml-6 sm:flex sm:space-x-8">
                            <a href="#" class="nav-link active" data-section="home">首页</a>
                            <a href="#" class="nav-link" data-section="docs">文档</a>
                            <a href="#" class="nav-link" data-section="community">社区</a>
                            <a href="#" class="nav-link" data-section="playground">体验</a>
                        </div>
                    </div>
                    <div class="flex items-center">
                        <div class="theme-switch" onclick="朵()">
                            <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z" />
                            </svg>
                        </div>
                    </div>
                </div>
            </div>
        </nav>
        <!-- 主要内容 -->
        <main class="flex-grow pt-12">
            <div id="home-content" class="content-section">
                <!-- Hero区域 -->
                <div class="bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 py-16">
                    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center">
                        <h1 class="text-4xl tracking-tight font-extrabold text-white sm:text-5xl md:text-6xl">
                            脑语言：用2500单字统一文明
                        </h1>
                        <p class="mt-3 max-w-md mx-auto text-base text-gray-100 sm:text-lg md:mt-5 md:text-xl md:max-w-3xl">
                            人与ASI共用的超级语言，让每个人都拥有魔法！
                        </p>
                        <div class="mt-5 max-w-md mx-auto sm:flex sm:justify-center md:mt-8">
                            <div class="rounded-md shadow">
                                <a href="#" class="w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-indigo-600 bg-white hover:bg-gray-50 md:py-4 md:text-lg md:px-10">
                                    开始使用
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
                 <!-- 示例代码区域 -->
            <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
                <h2 class="text-3xl font-bold mb-8">代码示例</h2>
                <div class="grid gap-6 md:grid-cols-2 lg:grid-cols-3">
                    <!-- 示例1 -->
                    <div class="bg-white dark:bg-gray-800 overflow-hidden shadow rounded-lg">
                        <div class="px-4 py-5 sm:p-6">
                            <h3 class="text-lg font-medium">你好，世界！</h3>
                            <div class="mt-4 bg-gray-50 dark:bg-gray-900 rounded p-4">
                                <pre><code class="text-sm">说 你好</code></pre>
                            </div>
                        </div>
                    </div>
                    <!-- 示例2 -->
                    <div class="bg-white dark:bg-gray-800 overflow-hidden shadow rounded-lg">
                        <div class="px-4 py-5 sm:p-6">
                            <h3 class="text-lg font-medium">计算1到10的和</h3>
                            <div class="mt-4 bg-gray-50 dark:bg-gray-900 rounded p-4">
                                <pre><code class="text-sm">总和 = 0
给 数字 从 1 到 10
    总和 = 总和 + 数字
出 总和</code></pre>
                            </div>
                        </div>
                    </div>
                    <!-- 示例3 -->
                    <div class="bg-white dark:bg-gray-800 overflow-hidden shadow rounded-lg">
                        <div class="px-4 py-5 sm:p-6">
                            <h3 class="text-lg font-medium">判断奇偶数</h3>
                            <div class="mt-4 bg-gray-50 dark:bg-gray-900 rounded p-4">
                                <pre><code class="text-sm">如 数字 除以 2 余数 等于 0
    出 "偶数"
别
    出 "奇数"</code></pre>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- 特性介绍 -->
            <div class="bg-gray-50 dark:bg-gray-900 py-12">
                <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
                    <h2 class="text-3xl font-bold mb-8">为什么选择脑语言？</h2>
                    <div class="grid gap-6 md:grid-cols-3">
                        <div class="bg-white dark:bg-gray-800 p-6 rounded-lg shadow">
                            <h3 class="text-xl font-semibold mb-4">中文编程</h3>
                            <p class="text-gray-500 dark:text-gray-400">使用自然的中文语法编写代码，无需记忆复杂的英文关键字。</p>
                        </div>
                        <div class="bg-white dark:bg-gray-800 p-6 rounded-lg shadow">
                            <h3 class="text-xl font-semibold mb-4">人工智能支持</h3>
                            <p class="text-gray-500 dark:text-gray-400">内置AI助手，帮助你解决编程问题，提供智能建议。</p>
                        </div>
                        <div class="bg-white dark:bg-gray-800 p-6 rounded-lg shadow">
                            <h3 class="text-xl font-semibold mb-4">跨平台兼容</h3>
                            <p class="text-gray-500 dark:text-gray-400">支持多种操作系统和设备，随时随地编写代码。</p>
                        </div>
                    </div>
                </div>
            </div>
        </main>
      <!-- 文档内容 -->
            <div id="docs-content" class="content-section hidden">
                <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
                    <div class="grid grid-cols-12 gap-8">
                        <!-- 侧边栏 -->
                        <div class="col-span-3">
                            <div class="sticky top-20">
                                <h3 class="text-lg font-medium mb-4">文档目录</h3>
                                <ul class="space-y-2">
                                    <li><a href="#intro" class="text-indigo-600 dark:text-indigo-400">入门指南</a></li>
                                    <li><a href="#basics" class="text-gray-600 dark:text-gray-400 hover:text-indigo-600">基础语法</a></li>
                                    <li><a href="#advanced" class="text-gray-600 dark:text-gray-400 hover:text-indigo-600">高级特性</a></li>
                                    <li><a href="#ai-features" class="text-gray-600 dark:text-gray-400 hover:text-indigo-600">AI集成</a></li>
                                    <li><a href="#examples" class="text-gray-600 dark:text-gray-400 hover:text-indigo-600">示例项目</a></li>
                                </ul>
                            </div>
                        </div>
                        <!-- 主要内容 -->
                        <div class="col-span-9">
                            <article class="prose dark:prose-invert max-w-none">
                                <h1 id="intro">入门指南</h1>
                                <p>欢迎使用脑语言！本指南将帮助你快速入门并掌握脑语言的基本用法。</p>
                                <h2>安装</h2>
                                <pre><code>pip install brain-lang</code></pre>
                                <h2>第一个程序</h2>
                                <pre><code>出 "你好，世界！"</code></pre>
                            </article>
                        </div>
                    </div>
                </div>
            </div>
            <!-- 社区内容 -->
            <div id="community-content" class="content-section hidden">
                <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
                    <div class="grid gap-8 md:grid-cols-2">
                        <!-- 论坛区域 -->
                        <div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
                            <h2 class="text-2xl font-bold mb-4">讨论区</h2>
                            <div class="space-y-4">
                                <div class="border-b dark:border-gray-700 pb-4">
                                    <h3 class="font-medium">如何用脑语言实现机器学习？</h3>
                                    <p class="text-sm text-gray-500 dark:text-gray-400">发布于 2024-03-15 • 42条回复</p>
                                </div>
                                <div class="border-b dark:border-gray-700 pb-4">
                                    <h3 class="font-medium">分享我用脑语言写的小游戏</h3>
                                    <p class="text-sm text-gray-500 dark:text-gray-400">发布于 2024-03-14 • 18条回复</p>
                                </div>
                            </div>
                        </div>
                        <!-- 资源区域 -->
                        <div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
                            <h2 class="text-2xl font-bold mb-4">学习资源</h2>
                            <div class="space-y-4">
                                <div class="border-b dark:border-gray-700 pb-4">
                                    <h3 class="font-medium">脑语言视频教程</h3>
                                    <p class="text-sm text-gray-500 dark:text-gray-400">30个精品视频课程</p>
                                </div>
                                <div class="border-b dark:border-gray-700 pb-4">
                                    <h3 class="font-medium">项目实战案例</h3>
                                    <p class="text-sm text-gray-500 dark:text-gray-400">15个实战项目源码</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- 体验环境 -->
            <div id="playground-content" class="content-section hidden">
                <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
                    <div class="grid grid-cols-2 gap-4 h-[600px]">
                        <!-- 代码编辑器 -->
                        <div class="bg-white dark:bg-gray-800 rounded-lg shadow p-4">
                            <div class="flex justify-between items-center mb-4">
                                <h3 class="text-lg font-medium">代码编辑器</h3>
                                <button onclick="执()" class="px-4 py-2 bg-indigo-600 text-white rounded hover:bg-indigo-700">
                                    运行
                                </button>
                            </div>
                            <textarea id="code-editor" class="w-full h-[500px] p-4 bg-gray-50 dark:bg-gray-900 rounded font-mono" spellcheck="false">出 "你好，世界！"</textarea>
                        </div>
                        <!-- 运行结果 -->
                        <div class="bg-white dark:bg-gray-800 rounded-lg shadow p-4">
                            <h3 class="text-lg font-medium mb-4">运行结果</h3>
                            <div id="output" class="h-[500px] p-4 bg-gray-50 dark:bg-gray-900 rounded font-mono overflow-auto">
                                // 运行结果将显示在这里
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </main>
        <!-- 页脚 -->
        <footer class="bg-white dark:bg-gray-800 shadow">
            <div class="max-w-7xl mx-auto py-12 px-4 sm:px-6 lg:px-8">
                <div class="text-center text-gray-500 dark:text-gray-400">
                    <a href="https://beian.miit.gov.cn/" target="_blank">&copy; 2025 微我 粤ICP备14090940号</a>
                </div>
            </div>
        </footer>
    </div>
    <script>
        // 导航切换
        document.querySelectorAll('.nav-link').forEach(link => {
            link.addEventListener('click', (e) => {
                e.preventDefault();
                const section = link.dataset.section;
                // 更新导航状态
                document.querySelectorAll('.nav-link').forEach(el => {
                    el.classList.remove('active');
                });
                link.classList.add('active');
                // 切换内容
                document.querySelectorAll('.content-section').forEach(el => {
                    el.style.display = 'none';
                });
                document.getElementById(section + '-content').style.display = 'block';
            });
        });
        // 代码复制功能
        function copyCode(button) {
            const code = button.parentElement.querySelector('code').innerText;
            navigator.clipboard.writeText(code).then(() => {
                button.textContent = '已复制!';
                setTimeout(() => {
                    button.textContent = '复制';
                }, 2000);
            });
        }
        function 执() {
            const code = document.getElementById('code-editor').value;
            const output = document.getElementById('output');
            try {
                // 这里是模拟代码运行
                const result = eval('(() => { ' + code.replace(/出/g, 'console.log') + ' })()');
                output.innerHTML = `运行成功:\n${result}`;
            } catch(error) {
                output.innerHTML = `运行错误:\n${error}`;
            }
        }
        function 朵() { // 修改后的主题切换相关代码
            const html = document.documentElement;
            const isDark = html.classList.contains('dark');
            const themeSwitch = document.querySelector('.theme-switch svg');
            
            if (isDark) {
                html.classList.remove('dark');
                localStorage.theme = 'light';
                // 切换到太阳图标
                themeSwitch.innerHTML = `
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z" />
                `;
            } else {
                html.classList.add('dark');
                localStorage.theme = 'dark';
                // 切换到月亮图标
                themeSwitch.innerHTML = `
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z" />
                `;
            }
        }
        function 初() {
            const html = document.documentElement;
            const themeSwitch = document.querySelector('.theme-switch svg');
            
            if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
                html.classList.add('dark');
                themeSwitch.innerHTML = `
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z" />
                `;
            } else {
                html.classList.remove('dark');
                themeSwitch.innerHTML = `
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z" />
                `;
            }
        }
        document.addEventListener('DOMContentLoaded', () => {
            初();
            document.querySelector('[data-section="home"]').click();
        });
    </script>
</body>
</html>